<script setup>
import { useRoute } from 'vue-router';
const route = useRoute();
</script>

<template>
  <div class="settings-container">
    <div class="settings-navbar">
      <div class="title">
        <i class="fas fa-cog"></i>
        <h1>{{ $t("system-settings") }}</h1>
      </div>
      <div class="links">
        <RouterLink to="/main/settings/general" class="nav-link" :class="{ active: route.path.includes('general') }">
          {{ $t("setting1") }}
        </RouterLink>
        <RouterLink to="/main/settings/info" class="nav-link" :class="{ active: route.path.includes('info') }">
          {{ $t("setting2") }}
        </RouterLink>
        <RouterLink to="/main/settings/password" class="nav-link" :class="{ active: route.path.includes('password') }">
          {{ $t("setting3") }}
        </RouterLink>
        <RouterLink to="/main/settings/logout" class="nav-link" :class="{ active: route.path.includes('logout') }">
          {{ $t("setting4") }}
        </RouterLink>
      </div>
    </div>
    <div class="settings-content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<style scoped>
.settings-container {
  width: 100%;
  padding: 0 20px;
}

.settings-navbar {
  background-color: var(--bgcolor);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0 25px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.settings-navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-color), var(--secondary-color));
}

.title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 14vw;
}

.title i {
  font-size: 1.5rem;
  color: var(--accent-color);
  background: rgba(59, 130, 246, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--txcolor);
}

.links {
  display: flex;
  gap: 10px;
  height: 100%;
  margin-right: 5vw;
}

.nav-link {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--secondary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--accent-color);
}

.nav-link.active {
  color: var(--accent-color);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-color);
  border-radius: 3px 3px 0 0;
  animation: underline 0.3s ease;
}
</style>